﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows.Art;
using System.Windows.Input;

namespace System.Windows.Elements
{
    static class StaticHelper
    {
        private static readonly Cursor colorPickerCursor;

        private static readonly Dictionary<ColorChannel, Func<Point, IColor>> MixersColorBar = new Dictionary<ColorChannel, Func<Point, IColor>>();
        private static readonly Dictionary<ColorChannel, Func<Point, IColor>> MixersPalette = new Dictionary<ColorChannel, Func<Point, IColor>>();
        private static readonly Dictionary<ColorChannel, Func<IColor, Point>> InverseMixersColorBar = new Dictionary<ColorChannel, Func<IColor, Point>>();
        private static readonly Dictionary<ColorChannel, Func<IColor, Point>> InverseMixersPalette = new Dictionary<ColorChannel, Func<IColor, Point>>();
        
        internal static readonly ColorChannel ccRgbA = ColorSpaces.Rgb.Alpha, ccRgbR = ColorSpaces.Rgb.Red, ccRgbG = ColorSpaces.Rgb.Green, ccRgbB = ColorSpaces.Rgb.Blue;
        internal static readonly ColorChannel ccLabL = ColorSpaces.Lab.Lightness, ccLabA = ColorSpaces.Lab.a, ccLabB = ColorSpaces.Lab.b;
        internal static readonly ColorChannel ccHsvH = ColorSpaces.Hsv.Hue, ccHsvS = ColorSpaces.Hsv.Saturation, ccHsvV = ColorSpaces.Hsv.Value;
        internal static readonly ColorChannel ccHslH = ColorSpaces.Hsl.Hue, ccHslS = ColorSpaces.Hsl.Saturation, ccHslL = ColorSpaces.Hsl.Lightness;

        static StaticHelper()
        {
            StaticHelper.colorPickerCursor = new Cursor(Application.GetResourceStream(new Uri("/System.Windows.Elements;component/Resources/ColorPickerCursor.cur", UriKind.RelativeOrAbsolute)).Stream);
        }

        public static Cursor ColorPickerCursor { get { return StaticHelper.colorPickerCursor; } }

        public static ColorChannel RgbAlpha { get { return ColorSpaces.Rgb.Alpha; } }

        public static ColorChannel RgbRed { get { return ColorSpaces.Rgb.Red; } }
        public static ColorChannel RgbGreen { get { return ColorSpaces.Rgb.Green; } }
        public static ColorChannel RgbBlue { get { return ColorSpaces.Rgb.Blue; } }
        
        public static ColorChannel HsvHue { get { return ColorSpaces.Hsv.Hue; } }
        public static ColorChannel HsvSaturation { get { return ColorSpaces.Hsv.Saturation; } }
        public static ColorChannel HsvValue { get { return ColorSpaces.Hsv.Value; } }

        public static ColorChannel LabLightness { get { return ColorSpaces.Lab.Lightness; } }
        public static ColorChannel LabA { get { return ColorSpaces.Lab.a; } }
        public static ColorChannel LabB { get { return ColorSpaces.Lab.b; } }
    }
}
